package game.soccerField.lines;

import game.ball.SoccerBall;

public class NorthLateralLine extends LimitLine {

	public NorthLateralLine(double x, double y, int width, int height) {
		super(x, y, width, height);
	}

	@Override
	public void execute() {
		SoccerBall ball = this.getScene().getSoccerBall();
		ball.getLastTouched().throwOutTheBall();
		if(ball.getLastTouched().isUserMate())
			this.getScene().announceOppNorthThrowIn(ball.getX(),this.getYToThrowIn());			
		else
			this.getScene().announceUserNorthThrowIn(ball.getX(),this.getYToThrowIn());
	}
	
	public double getYToThrowIn(){
		return this.getY()+this.getAppearance().getHeight()+5;			
	}
	
}
